package com.chao.product.message;

import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.io.IOException;

@Component
@RabbitListener(queues = "dead_queue_1")
public class DeadTopicMsg1 {

    @RabbitHandler
    public void topicGetMsg(String content, Message message, Channel channel) throws IOException {
        System.out.println(message.getMessageProperties().getReceivedRoutingKey());
        System.out.println("consumer-3:" + content);
    }
}
